<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>jsonp跨域的应用</title>
		
		<!--
        	https://www.cnblogs.com/think-in-java/p/7285296.html?utm_source=itdadao&utm_medium=referral
        	使用的服务器url
        -->
		<!--引入jquery-->
		<script type="text/javascript" src="static/js/jquery-1.12.4/jquery-1.12.4.min.js">
			
			
		</script>
		
		<script type="text/javascript">
			function dojsonp(data){
				console.info(data);
				alert("jsonp请求成功");
			}
		</script>
		<!--
        	因为script标签的src属性不受同源策越限制，所有通过src属性向服务器发送请求；
        -->
		
		
		<!--<script type="text/javascript" src="https://api.douban.com/v2/book/search?q=javascript&count=1&callback=dojsonp">
			
		</script>-->
		
		<script type="text/javascript" src="http://localhost:8070/mavenssm1019/AjaxQueryDemoAction3?callback=dojsonp">
			
		</script>
		<!--上面的script标签的src属性请求完成之后，会获取如下形式的内容，然后再作为js代码进行解释执行-->
		<!--<script type="text/javascript">
			
			donjsonp("123");
			
			dojsonp(
				{"count":1,"start":0,"total":1557,"books":[{"rating":{"max":10,"numRaters":499,"average":"9.2","min":0},"subtitle":"The Good Parts","author":["Douglas Crockford"],"pubdate":"2008-5","tags":[{"count":462,"name":"javascript","title":"javascript"},{"count":264,"name":"JavaScript","title":"JavaScript"},{"count":163,"name":"前端开发","title":"前端开发"},{"count":93,"name":"编程","title":"编程"},{"count":87,"name":"web","title":"web"},{"count":84,"name":"Web开发","title":"Web开发"},{"count":79,"name":"计算机","title":"计算机"},{"count":73,"name":"programming","title":"programming"}],"origin_title":"","image":"https://img3.doubanio.com\/view\/subject\/m\/public\/s2931482.jpg","binding":"Paperback","translator":[],"catalog":"","pages":"172","images":{"small":"https://img3.doubanio.com\/view\/subject\/s\/public\/s2931482.jpg","large":"https://img3.doubanio.com\/view\/subject\/l\/public\/s2931482.jpg","medium":"https://img3.doubanio.com\/view\/subject\/m\/public\/s2931482.jpg"},"alt":"https:\/\/book.douban.com\/subject\/2994925\/","id":"2994925","publisher":"Yahoo Press","isbn10":"0596517742","isbn13":"9780596517748","title":"JavaScript","url":"https:\/\/api.douban.com\/v2\/book\/2994925","alt_title":"","author_intro":"Douglas Crockford is a Senior JavaScript Architect at Yahoo!. He is the maintainer of the JSON format, and a regular speaker at conferences on advanced JavaScript topic. He is also on the JavaScript 2.0 committee at ECMA.","summary":"Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined. This authoritative book offers a detailed explanation of the features that make JavaScript an outstanding object-oriented programming language, and warns you about the bad parts.\nIn the process, JavaScript: The Good Parts defines a subset of JavaScript that's more reliable, readable, and maintainable than the language as a whole. Author Douglas Crockford, a member of JavaScript 2.0 committee at ECMA, is considered by many people in the development community to be the JavaScript expert.\nA beautiful, elegant, lightweight and highly expressive language lies buried under a steaming pile of good intentions and blunders, he explains. The very good ideas include functions, loose typing, dynamic objects, and an expressive object literal notation. Awful ideas include a programming model based on global variables. With JavaScript: The Good Parts, you can release this elegant programming language from its old shell, and create more maintainable, extensible, and efficient code.\nThe book's topics include:\n* Syntax\n* Objects\n* Functions\n* Inheritance\n* Arrays\n* Regular expressions\n* Methods\n* Style\n* Beautiful features\nAppendices summarize JavaScript's bad parts and awful parts. But the greatest benefit of studying the good parts is that you can avoid the need to unlearn the bad parts. If you want to learn more about the bad parts and how to use them badly, consult any other JavaScript book.\nJavaScript is the language of the Web -- the only language found in all browsers -- so avoiding it altogether is not an alternative. But, whether you're managing object libraries or just trying to get Ajax to run fast, Crockford's guidance in JavaScript: The Good Parts will help you create truly effective JavaScript code.","price":"GBP 23.99"}]}
				);
		</script>-->
				
	</head>

	<body>
	</body>

</html>